#-------------------------------------#
#       对单张图片进行预测
#-------------------------------------#
from yolo import YOLO
from PIL import Image
import time

yolo = YOLO()
pix_pre = 'D:\Work\myselfV1\\test\\'
test_set=['2.jpg','3.jpg','a1.jpg','a2.jpg','a3.jpg','a4.jpg','a5.jpg','a6.jpg','a7.jpg',
     'b1.jpg','b2.jpg','b3.jpg','b4.jpg','b5.jpg','b6.jpg','b7.jpeg','b8.jpeg','b9.jpeg',
     'b10.jpeg','b11.jpeg','b12.jpg','b13.image','b14.image']
# train_set = ['D:\python\Aclass\\1\myselfV1\data\JPEGImages\\2836.jpg','D:\python\Aclass\\1\myselfV1\data\JPEGImages\\2837.jpg']
# val_set = ['D:\python\Aclass\\1\myselfV1\data\JPEGImages\\1.jpg','D:\python\Aclass\\1\myselfV1\data\JPEGImages\\100.jpg']
for i in test_set:
    path = pix_pre+i
    # path = i
    image = Image.open(path)
    start = time.time()
    r_image = yolo.detect_image(image)
    finish = time.time()
    print('cost:%f s' % (finish - start))
    r_image.show()

